#/usr/bin/perl
use strict;
my $dataDir ="C:\\CMUToolkit\\experiment\\hindi\\CleanSMS.txt";
#my @files = `dir/b $dataDir`;
my $mergedFile = "C:\\CMUToolkit\\experiment\\hindi\\CleanSMScorpus.txt";
open(MF, ">$mergedFile") || die();

#foreach my $file (@files){
	my $file = $dataDir; #."\\".$file;
	open(file, $file)|| die();
	while(<file>){
		if($_=~/[\w]/){
			print $_;
			chomp($_);
			$_ =~ s/[\s]+/ /ig;
			#$_ =~ s/[\s]/#/ig;
			my @arr= split("",$_);
			for(my $i=0; $i <$#arr + 1; $i++){
				if($arr[$i]=~m/[\s]/){print MF "#";}
				else{print MF " ".$arr[$i];}
				
			}
			print MF "\n";
		}
	}
	close(file);	
#}
close(MF);